/**
 * Copyright (C), 2015, 上海赛可电子商务有限公司
 * Author:   张卫明
 * Date:     2015-4-28
 * lever:    page
 * Description: 首页js
 */

;(function($,window) {

	homePage = {

		init:function(){

			//全屏轮播
			ECar.fullSlide({
				'ele': "js_banner",
				'showmarkers':true,
				'showcontrols':false,
				'autoplay':true,
				'animspeed': "4000",
				'height': 444
			});

			//图片懒加载
			$("img.lazy").lazyload({effect: "fadeIn"});

			//图文互动效果
			this.productMove();

			//显示掩藏88节 入口
			this.active88();
		},

		active88:function(){

			var 	giftCont = $('#js_gift_cont'),
			 	giftBox =  $('#js_gift_box'),
			 	footerNode = $('#js_cxgb_site_footer');

			$(window).scroll(function(){
				if(($(window).scrollTop() + 753 ) >footerNode.offset().top){
					giftBox.hide();
				} else{
					giftBox.show();
				}
			});

		},

		productMove:function(){
			var $provideLi = $('.js_boxHover'),
				_this = this;

			$provideLi.hover(function(){
				$(this).stop().animate({'margin-top':'-5px'},300).css("box-shadow","0 0 13px #999");
			},function(){
				$(this).stop().animate({'margin-top':'0px'},300).css("box-shadow","none");
			});
		}
	};

	homePage.init();

})(jQuery,window);